import Layout from '@/layout'
/**
注意：子菜单仅在路由children.length> = 1时出现
 *详细信息请参见：https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 *隐藏：如果设置为true，则为true，则项目不会显示在边栏中（默认为false）
 * alwaysShow：如果设置为true，则将始终显示根菜单
 *如果未设置alwaysShow，则当项具有多个子路线时，
 *它将变为嵌套模式，否则不显示根菜单
 * redirect：noRedirect如果设置了noRedirect将不会在面包屑中重定向
 * name：'路由器名称'，该名称由<keep-alive>使用（必须设置！！！）
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
   * meta：{
    roles：['admin'，'editor']控制页面角色（您可以设置多个角色）
    title：“ title”名称显示在侧边栏和面包屑中（推荐设置）
    icon：'svg-name'/'el-icon-x'图标显示在侧栏中
    面包屑：如果设置为false，则该项将隐藏在面包屑中（默认值为true）
    activeMenu：如果设置了路径，则为“ / example / list”，边栏将突出显示您设置的路径
  }
 */

export default [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/Home',
    children: [{
      path: 'Home',
      name: '仪表盘',
      component: () => import('@/views/home/index'),
      meta: { title: '首页', icon: 'dashboard' }
    }]
  },

  {
    path: '/example',
    component: Layout,
    redirect: '/example/table',
    name: '表树例子',
    meta: { title: '表树例子', icon: 'el-icon-s-help' },
    children: [
      {
        path: 'table',
        name: '表',
        component: () => import('@/views/table/index'),
        meta: { title: 'Table', icon: 'table' }
      },
      {
        path: 'tree',
        name: '树',
        component: () => import('@/views/tree/index'),
        meta: { title: 'Tree', icon: 'tree' }
      }
    ]
  },

  {
    path: '/form',
    component: Layout,
    children: [
      {
        path: 'index',
        name: '表单',
        component: () => import('@/views/form/index'),
        meta: { title: '表单', icon: 'form' }
      }
    ]
  },

  {
    path: '/nested',
    component: Layout,
    redirect: '/nested/menu1',
    name: '菜单',
    meta: {
      title: '菜单',
      icon: 'nested'
    },
    children: [
      {
        path: 'menu1',
        component: () => import('@/views/nested/menu1/index'), // Parent router-view
        name: 'Menu1',
        meta: { title: 'Menu1' },
        children: [
          {
            path: 'menu1-1',
            component: () => import('@/views/nested/menu1/menu1-1'),
            name: 'Menu1-1',
            meta: { title: 'Menu1-1' }
          },
          {
            path: 'menu1-2',
            component: () => import('@/views/nested/menu1/menu1-2'),
            name: 'Menu1-2',
            meta: { title: 'Menu1-2' },
            children: [
              {
                path: 'menu1-2-1',
                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
                name: 'Menu1-2-1',
                meta: { title: 'Menu1-2-1' }
              },
              {
                path: 'menu1-2-2',
                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
                name: 'Menu1-2-2',
                meta: { title: 'Menu1-2-2' }
              }
            ]
          },
          {
            path: 'menu1-3',
            component: () => import('@/views/nested/menu1/menu1-3'),
            name: 'Menu1-3',
            meta: { title: 'Menu1-3' }
          }
        ]
      },
      {
        path: 'menu2',
        component: () => import('@/views/nested/menu2/index'),
        name: 'Menu2',
        meta: { title: 'menu2' }
      }
    ]
  },

  {
    path: 'external-link',
    component: Layout,
    children: [
      {
        path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
        meta: { title: '打开新标签', icon: 'link' }
      }
    ]
  },
  {
    path: '/moment',
    component: Layout,
    children: [
      {
        path:'index',
        name: '日期处理',
        component: () => import('@/views/moment/index'),
        meta: { title: '日期处理', icon: 'form' }
      }
    ]
  },
  {
    path: '/search',
    component: Layout,
    children: [
      {
        path:'index',
        name: '关键词搜索',
        component: () => import('@/views/search/index'),
        meta: { title: '关键词搜索', icon: 'form' }
      }
    ]
  },
  {
    path: '/drawer',
    component: Layout,
    children: [
      {
        path:'index',
        name: '抽屉',
        component: () => import('@/views/drawer/drawer'),
        meta: { title: '抽屉', icon: 'form' }
      }
    ]
  },
  {
    path: '/select',
    component: Layout,
    children: [
      {
        path:'index',
        name: '级联选择',
        component: () => import('@/views/select/index'),
        meta: { title: '级联选择', icon: 'form' }
      },
      {
        path:'addSupplier',
        name: '添加供应商',
        component: () => import('@/views/select/addSupplier'),
        meta: { title: '添加供应商', icon: 'form' },
        hidden: true
      }
    ]
  },
  {
    path: '/testcss',
    component: Layout,
    children: [
      {
        path:'index',
        name: '测试css',
        component: () => import('@/views/testcss'),
        meta: { title: '测试css', icon: 'form' }
      }
    ]
  },
  {
    path: '/tree',
    component: Layout,
    children: [
      {
        path:'index',
        name: '树组件',
        component: () => import('@/views/tree'),
        meta: { title: '树组件', icon: 'form' }
      }
    ]
  },
  {
    path: '/dragDialog',
    component: Layout,
    children: [
      {
        path:'index',
        name: '拖拽对话框',
        component: () => import('@/views/dragDialog/index'),
        meta: { title: '拖拽对话框', icon: 'form' }
      }
    ]
  },
  {
    path: '/clipboard',
    component: Layout,
    children: [
      {
        path:'index',
        name: '剪贴板',
        component: () => import('@/views/clipboard/index'),
        meta: { title: '剪贴板', icon: 'form' }
      }
    ]
  },
  {
    path: '/richText',
    component: Layout,
    name:'富文本',
    meta: { title: '富文本', icon: 'form' },
    children: [
      {
        path:'index',
        name: 'quillEditor',
        component: () => import('@/views/richText/index'),
        meta: { title: 'quillEditor', icon: 'form' }
      },
      {
        path:'wand',
        name: 'wandEdit',
        component: () => import('@/views/richText/wandEditor'),
        meta: { title: 'wandEdit', icon: 'form' }
      }
    ]
  },
  {
    path: '/testjs',
    component: Layout,
    children: [
      {
        path:'index',
        name: '处理数组对象',
        component: () => import('@/views/testjs/index'),
        meta: { title: '处理数组对象', icon: 'form' }
      }
    ]
  },
  {
    path: '/filters',
    component: Layout,
    children: [
      {
        path:'index',
        name: '过滤器',
        component: () => import('@/views/filter/index'),
        meta: { title: '过滤器', icon: 'form' }
      }
    ]
  },
  {
    path: '/slot',
    component: Layout,
    children: [
      {
        path:'index',
        name: '插槽',
        component: () => import('@/views/slot/index'),
        meta: { title: '插槽', icon: 'form' }
      }
    ]
  },
  {
    path: '/export',
    component: Layout,
    children: [
      {
        path:'index',
        name: '导入导出',
        component: () => import('@/views/export/index'),
        meta: { title: '导入导出', icon: 'form' }
      }
    ]
  },
  {
    path: '/scroll',
    component: Layout,
    children: [
      {
        path:'index',
        name: '滚动条',
        component: () => import('@/views/scroll/index'),
        meta: { title: '滚动条', icon: 'form' }
      }
    ]
  },
  {
    path: '/vuex',
    component: Layout,
    children: [
      {
        path:'index',
        name: 'vuex',
        component: () => import('@/views/vuex/index'),
        meta: { title: 'vuex', icon: 'form' }
      }
    ]
  },
  {
    path: '/route',
    component: Layout,
    children: [
      {
        path:'index',
        name: 'route',
        component: () => import('@/views/route/index'),
        meta: { title: 'route', icon: 'form' }
      },
      {
        path:'detail/:id',
        name: 'detail',
        component: () => import('@/views/route/detail'),
        hidden: true,
      }
    ]
  },
  {
    path: '/404',
    name: 'error_404',
    component: () => import('@/views/404'),
    hidden: true
  },
  // 404 page must be placed at the end !!!
  { path: '*', redirect: '/404', hidden: true }
]
